package top.hongthorn.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import top.hongthorn.pojo.RegionalEventOne;
import top.hongthorn.service.RegionalEventOneService;
import top.hongthorn.util.Result;

import java.util.Map;

/**
 * <p>
 * 地区事件1 前端控制器
 * </p>
 *
 * @author 泓宇网络科技工作室
 * @since 2023-12-28 00:47:55
 */
@RestController
@RequestMapping("/regionalEventOne")
@Api(value = "RegionalEventOneControll",tags = "RegionalEventOneControll")
public class RegionalEventOneController {
    @Autowired
    private RegionalEventOneService service;
    @ApiOperation(value = "添加事件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "aircraftCarrierPort",value = "航母舷号",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "moment",value = "时刻",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "longitude",value = "经度",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "latitude",value = "纬度",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "politicalEvents",value = "政治事件",dataType = "String",paramType = "query",required = true)
    })
    @RequestMapping(value = "/insert",method = RequestMethod.GET)
    public Result insert(RegionalEventOne regionalEventOne){
        return service.insert(regionalEventOne);
    }
    @ApiOperation(value = "事件数据分页")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页码", dataType = "Integer", example = "1", required = false),
            @ApiImplicitParam(name = "limit", value = "显示条数", dataType = "Integer", example = "3", required = false),
    })
    @RequestMapping(value = "/selectPage", method = RequestMethod.GET)
    public Map selectPage(Integer page, Integer limit){
        return service.selectPage(page, limit);
    }

    @ApiOperation(value = "修改事件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "aircraftCarrierPort",value = "航母舷号",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "moment",value = "时刻",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "longitude",value = "经度",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "latitude",value = "纬度",dataType = "String",paramType = "query",required = true),
            @ApiImplicitParam(name = "politicalEvents",value = "政治事件",dataType = "String",paramType = "query",required = true)
    })
    @RequestMapping(value = "/updateId",method = RequestMethod.GET)
    public Result updateId(RegionalEventOne RegionalEventOne){
        return service.updateId(RegionalEventOne);
    }

    @ApiOperation(value = "删除事件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "事件ID",dataType = "Integer",paramType = "query",required = true)
    })
    @RequestMapping(value = "/deletById",method = RequestMethod.GET)
    public Result deletById(Integer id){
        return service.deletById(id);
    }
}
